/**
 * 
 */
package br.com.skynix.tcmc.controller.configuracao.financeiro.centros_custos;

import java.util.List;

import javax.annotation.Resource;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import org.springframework.stereotype.Controller;

import br.com.skynix.tcmc.base.managedbeans.AbstractCRUDManagedBean;
import br.com.skynix.tcmc.base.spring.IServiceAuditavel;
import br.com.skynix.tcmc.model.financeiro.CentroCusto;
import br.com.skynix.tcmc.model.financeiro.Natureza;
import br.com.skynix.tcmc.service.configuracao.financeiro.centros_custos.CentroCustoService;
import br.com.skynix.tcmc.service.configuracao.financeiro.naturezas.NaturezaService;

/**
 * @author davi
 * 
 */
@ManagedBean
@RequestScoped
@Controller
public class CentroCustoMB extends AbstractCRUDManagedBean<CentroCusto> {
	@Resource
	private CentroCustoService centroCustoService;

	@Resource
	private NaturezaService naturezaService;

	public CentroCustoMB() {
		setModeloPesquisa(new CentroCusto());
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * br.com.skynix.tcmc.base.managedbeans.AbstractCRUDManagedBean#getService()
	 */
	@Override
	protected IServiceAuditavel<CentroCusto> getService() {
		return centroCustoService;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see br.com.skynix.tcmc.base.managedbeans.AbstractCRUDManagedBean#
	 * getPathParaModuloCRUD()
	 */
	@Override
	protected String getPathParaModuloCRUD() {
		return formatPath("configuracao/financeiro/centros_custos/centro_custo_crud_view");
	}

	public List<Natureza> getListaNatureza() {
		return naturezaService.listarTodos(getModeloEdicao().getEmpresa());
	}
}
